package com.chinasofti.thread01;

        import sun.net.ftp.FtpClient;

        import java.util.concurrent.ExecutionException;
        import java.util.concurrent.FutureTask;

public class MyCallableDemo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallable mc = new MyCallable();

        FutureTask<String> ft =  new FutureTask<>(mc);

        Thread t1 = new Thread(ft);
        //String s = ft.get();
        t1.start();

        String s = ft.get();
        System.out.println("s = " + s);
    }
}
